package vn.cuhanh.utils;

import java.lang.Thread.UncaughtExceptionHandler;

//import vn.cuhanh.MainActivity;
//
//import android.util.Log;

public class ZGExceptionHandler implements UncaughtExceptionHandler {
	private UncaughtExceptionHandler defaultUEH;

	/*
	 * if any of the parameters is null, the respective functionality will not
	 * be used
	 */
	public ZGExceptionHandler() {
		this.defaultUEH = Thread.getDefaultUncaughtExceptionHandler();
	}

	public void uncaughtException(Thread thread, Throwable ex) {
		ex.printStackTrace();

		// Log here:
		HelperFunc.readStackTrace(ex, true);
		// ((MainActivity) MainActivity.ctx).onDestroy();
		this.defaultUEH.uncaughtException(thread, ex);

	}

}
